unit SmallStruct.Configuration.TSSViewExtendConfiguration;

interface

uses Classes,
  SmallStruct.Core,
  SmallStruct.Configuration.TSSConfiguration,
  SmallStruct.Configuration;

type
  TSSViewExtendConfiguration = class(TSSConfiguration, ISSViewExtendConfiguration)
  private
    _FieldConfiguration: ISSObjectContainer;
  public
    function GetFieldConfiguration: ISSObjectContainer;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

  TSSViewExtendFieldConfiguration = class(TSSConfiguration, ISSViewExtendFieldConfiguration)
  private
    _IsAggregateGroup, _IsDisplay, _IsGroup: Boolean;
    _DisplayOrder, _GroupOrder: Integer;
    _FieldName: string;
    _AggregateType: TSSAggregateType;
    _SortOrder: TSSSortOrder;
  public
    procedure SetAggregateGroup(const AIsAggregateGroup: Boolean);
    procedure SetAggregateType(const AAggregateType: TSSAggregateType);
    procedure SetDisplayOrder(const ADisplayOrder: Integer);
    procedure SetFieldName(const AFieldName: string);
    procedure SetGroupOrder(const AGroupOrder: Integer);
    procedure SetSortOrder(const ASortOrder: TSSSortOrder);
    procedure SetDisplay(const AIsDisplay: Boolean);
    procedure SetGroup(const AIsGroup: Boolean);
  public
    function GetAggregateType: TSSAggregateType;
    function GetDisplayOrder: Integer;
    function GetFieldName: string;
    function GetGroupOrder: Integer;
    function GetSortOrder: TSSSortOrder;
    function IsAggregateGroup: Boolean;
    function IsDisplay: Boolean;
    function IsGroup: Boolean;
  end;

implementation

uses SmallStruct.Core.TSSObjectContainer;

{ TSSViewExtendConfiguration }

constructor TSSViewExtendConfiguration.Create(AOwner: TComponent);
begin
  inherited;
  _FieldConfiguration := TSSObjectContainer.Create(Self);
end;

destructor TSSViewExtendConfiguration.Destroy;
begin
  _FieldConfiguration.ReleaseObject;
  _FieldConfiguration.ReleaseObjectInstance;
  inherited;
end;

function TSSViewExtendConfiguration.GetFieldConfiguration: ISSObjectContainer;
begin
  Result := _FieldConfiguration;
end;

{ TSSViewExtendFieldConfiguration }

function TSSViewExtendFieldConfiguration.GetAggregateType: TSSAggregateType;
begin
  Result := _AggregateType;
end;

function TSSViewExtendFieldConfiguration.GetDisplayOrder: Integer;
begin
  Result := _DisplayOrder;
end;

function TSSViewExtendFieldConfiguration.GetFieldName: string;
begin
  Result := _FieldName;
end;

function TSSViewExtendFieldConfiguration.GetGroupOrder: Integer;
begin
  Result := _GroupOrder;
end;

function TSSViewExtendFieldConfiguration.GetSortOrder: TSSSortOrder;
begin
  Result := _SortOrder;
end;

function TSSViewExtendFieldConfiguration.IsAggregateGroup: Boolean;
begin
  Result := _IsAggregateGroup;
end;

function TSSViewExtendFieldConfiguration.IsDisplay: Boolean;
begin
  Result := _IsDisplay;
end;

function TSSViewExtendFieldConfiguration.IsGroup: Boolean;
begin
  Result := _IsGroup;
end;

procedure TSSViewExtendFieldConfiguration.SetAggregateGroup(const AIsAggregateGroup: Boolean);
begin
  _IsAggregateGroup := AIsAggregateGroup;
end;

procedure TSSViewExtendFieldConfiguration.SetAggregateType(const AAggregateType: TSSAggregateType);
begin
  _AggregateType := AAggregateType;
end;

procedure TSSViewExtendFieldConfiguration.SetDisplay(const AIsDisplay: Boolean);
begin
  _IsDisplay := AIsDisplay;
end;

procedure TSSViewExtendFieldConfiguration.SetDisplayOrder(const ADisplayOrder: Integer);
begin
  _DisplayOrder := ADisplayOrder;
end;

procedure TSSViewExtendFieldConfiguration.SetFieldName(const AFieldName: string);
begin
  _FieldName := AFieldName;
end;

procedure TSSViewExtendFieldConfiguration.SetGroup(const AIsGroup: Boolean);
begin
  _IsGroup := AIsGroup;
end;

procedure TSSViewExtendFieldConfiguration.SetGroupOrder(const AGroupOrder: Integer);
begin
  _GroupOrder := AGroupOrder;
end;

procedure TSSViewExtendFieldConfiguration.SetSortOrder(const ASortOrder: TSSSortOrder);
begin
  _SortOrder := ASortOrder;
end;

end.
